<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<html>
	<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <script type="text/javascript">
		function reset_system_info(){
		  $('#sysno').val('');
		  $('#sysname').val('');
		  $('#clerknolen').val('');
		}
		function on_panel_open(){
    	  $('#clerksysno').combobox({url:'querySystemList.action?flag=1'});
    	  $('#clerksysno').combobox('setValue','a');
    	  combobox_keypress('#clerksysno','#save');
		}
        function on_panel_close(){
          reset_system_info();
          $("#add_system_panel").panel("destroy");
        }
    	$(document).ready(function(){
    	  set_input_keydown_event();
    	      	  
    	  $('#save').click(function (){
    	    $('#clerksysno_val').val($('#clerksysno').combobox('getValue'));
    	    $('#add_system_form').form('submit', {
    		  url: 'addSystemInfo.action',
    		  error:function(message){
    		    alert('提交数据错误，服务器可能已关闭！系统返回:'+message);
    		  },
    		  success:function(data){
    		    var a = eval('(' + data + ')');
    		    $.messager.alert('增加系统', a.message, 'info',
    		    	function(){$('#sysno').focus();});
    		    
    		    if (a.result=='0'){
    		  	  reset_system_info();
    		  	  $('#clerksysno').combobox('reload', 'querySystemList.action?flag=1');
    		    }
    		  }
    	    })
    	  });
    	
    	  $('#add_system_panel').panel({onOpen:on_panel_open,onClose:on_panel_close});
     		$('#cancel').click(function (){
     			$('#add_system_panel').panel('close');
    		});
    	  });
    </script>
	</head>
	<body>

    <div id="add_system_panel" fit="true" title="增加系统" 
    	resizable="false" collapsible="false" minimizable="false" maximizable="false" 
    	closable="true" icon="icon-save" class="jquery_panel">
    	<s:form id="add_system_form" action="addSystemInfo" cssStyle="margin:20px,40px">
    		<table>
    			<tr style="vertical-align: top">
    				<td>
    					<table>
    						<tr height="28px">
			    				<td><s:label value="系统号：" for="sysno"></s:label></td>
    							<td><input id="sysno" name="sysno" style="width:150px"
    								maxlength=<s:property value="%{getText('SYSNO_LEN')}"/>  
			    					class="text_field_css"></input>
			    					<label style="width:4px"></label>
			    					<label style="color:red">*</label>
			    					<label>必输项</label></td>
    						</tr>
			    			<tr height="28px">
    							<td><s:label value="系统名称：" for="sysname"></s:label></td>
			    				<td><input id="sysname" name="sysname" style="width:150px"
    								maxlength=<s:property value="%{getText('SYSNAME_LEN')}"/>  
    								class="text_field_css"></input>
    								<label style="width:4px"></label>
			    					<label style="color:red">*</label>
			    					<label>必输项</label></td>
			    			</tr>
			    			<tr height="28px">
    							<td><s:label value="账户号长度：" for="clerknolen"></s:label></td>
			    				<td><input id="clerknolen" name="clerknolen" style="width:150px"
    								maxlength=2  class="text_field_css"></input>
    								<label style="width:4px"></label>
			    					<label style="color:red">*</label>
			    					<label>必输项</label></td>
			    			</tr>
    						<tr height="28px">
			    				<td><s:label value="账户归属：" for="clerksysno"></s:label></td>
    							<td><s:textfield id="clerksysno" valueField="sysno" textField="sysname" 
    								style="width:200px" editable="false" panelHeight="auto"></s:textfield>
			    					<s:hidden id="clerksysno_val" name="clerksysno"></s:hidden> </td>
    						</tr>
			    			<tr>
    							<td colspan="2" align="center">
            						<button id="save" class="buttons_css" style="width:70px">
            							<label style="70px" class="save_css">保存</label></button>
            						<label style="width:20px"></label>
            						<button id="cancel" class="buttons_css" style="width:70px">
            							<label style="70px" class="cancel_css">返回</label></button>
			    				</td>
    						</tr>
			    		</table>
			    	</td>
    			</tr>
    		</table>
    	</s:form>
    </div>
    </body>
</html>